//
//  CMDefine.h
//  ThridPackage
//
//  Created by 韩艳锋 on 2019/7/17.
//  Copyright © 2019 韩艳锋. All rights reserved.
//

#ifndef CMDefine_h
#define CMDefine_h


#endif /* CMDefine_h */

#pragma 引用
#define WEAKSELF  __weak typeof(self) WEAKTHIS = self;
#define STRONGSELF_NORETURN __strong typeof(WEAKTHIS) self = WEAKTHIS;
#define STRONGSELF_RETURN_EMPTY __strong typeof(WEAKTHIS) self = WEAKTHIS; if (!self) return;
#define STRONGSELF_RETURNVALUE(value) __strong typeof(WEAKTHIS) self = WEAKTHIS; if (!self) return value;
#define STRONGSELF_RETURNBOOL(BOOL) __strong typeof(WEAKTHIS) self = WEAKTHIS; if (!self) return BOOL;
#define STRONGSELF_RETURNE_NIL __strong typeof(WEAKTHIS) self = WEAKTHIS; if (!self) return nil;

#pragma 适配
#define SCREEN_WIDTH  [UIScreen mainScreen].bounds.size.width

#define safeMain(block)\
if ([NSThread isMainThread]) {\
block();\
} else {\
dispatch_async(dispatch_get_main_queue(), block);\
}

//#define extensionProtocol(NAME) \
//interface NAME ## TemporaryClass : NSObject <NAME> \
//@end \
//@implementation NAME ## TemporaryClass \



#define extensionProtocol(NAME) \
interface NAME ## _HFDefoutImplementation : NSObject <NAME> \
@end \
@implementation NAME ## _HFDefoutImplementation \
